import 'package:flutter/material.dart';

/// 种草card
class CustomCard4 extends StatelessWidget {
  const CustomCard4({
    Key? key,
    required this.imageUrl,
    required this.title,
  }) : super(key: key);

  final String imageUrl;
  final String title;

  @override
  Widget build(BuildContext context) {
    return Card(
      clipBehavior: Clip.antiAlias,
      child: Column(
        children: [
          Image.network(
            imageUrl,
            width: double.maxFinite,
            height: 175,
            fit: BoxFit.cover,
          ),
          Container(
            margin: const EdgeInsets.only(top: 10),
            padding: const EdgeInsets.symmetric(horizontal: 10),
            child: Text(
              title,
              maxLines: 2,
              overflow: TextOverflow.ellipsis,
              style: Theme.of(context).textTheme.bodyText1,
            ),
          ),
          Container(
            padding: const EdgeInsets.symmetric(horizontal: 10),
            margin: const EdgeInsets.only(top: 4),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                Row(
                  children: [
                    ClipRRect(
                      borderRadius: BorderRadius.circular(24),
                      child: Image.network(
                        "https://cdn.xihaf.com/template/a0.jpg",
                        width: 24,
                        height: 24,
                        fit: BoxFit.fill,
                      ),
                    ),
                    Container(
                      margin: const EdgeInsets.only(left: 10),
                      child: const Text("♪(･ω･)"),
                    ),
                  ],
                ),
                Row(
                  children: [
                    const Icon(
                      Icons.favorite,
                      size: 18,
                      color: Colors.red,
                    ),
                    Container(
                      margin: const EdgeInsets.only(left: 4),
                      child: Text(
                        '99+',
                        style: Theme.of(context).textTheme.bodyText2,
                      ),
                    )
                  ],
                )
              ],
            ),
          )
        ],
      ),
    );
  }
}
